package org.numb.concurrency.chapter02;

public class MyThread extends Thread{
    // 重写run()方法，放入线程执行的内容
    @Override
    public void run() {
        int i = 0;
        while(i < 100) {
            System.out.println("Thread running: " + i++);
        }
    }

    public static void main(String[] args) {
        MyThread thread = new MyThread();
        // thread.start()启动线程，会自动调用thread.run()
        thread.start();
    }
}
